import { ApiCall } from "tsrpc";
import { ReqLook, ResLook } from "../../../../shared/master/body/pet/PtlLook";
import { player } from "../../../../model/fight/body/player";
import { template } from "../../../../shared/master/MsgAction";

export default async function (call: ApiCall<ReqLook, ResLook>) {
    call.succ({});
    let user = call.req._player as player;
    const pets =  user.getPets();
    const lookPet = pets[call.req.idx - 1]
    if(!lookPet){
        user.sendMsg(template.default,`没有找到ID为[${call.req.idx}]的宠物`);
        return;
    }
    let tpl = lookPet.getMsgAttTpl()
    user.sendMsg(tpl.template,tpl.data);
}